<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\ConfigBean;

class ConfigValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 ConfigBean::$id => 'require', //
			 ConfigBean::$storeId => 'require', //商家id
			 ConfigBean::$special => 'require', //主后台拥有（1、是，2、默认数据）
			 ConfigBean::$configKey => 'require|max:255', //key值
			 ConfigBean::$configName => 'require|max:255', //名称
			 ConfigBean::$value => 'require', //值
			 ConfigBean::$type => 'require', //1 input 2 图片 3富文本
			 ConfigBean::$createdAt => 'require', //
			 ConfigBean::$updatedAt => 'require', //
		];
		$this->message = [
			ConfigBean::$id.POINST."require " => 'id必须', //
			ConfigBean::$storeId.POINST."require " => 'store_id必须', //商家id
			ConfigBean::$special.POINST."require " => 'special必须', //主后台拥有（1、是，2、默认数据）
			ConfigBean::$configKey.POINST."require " => 'config_key必须', //key值
			ConfigBean::$configName.POINST."require " => 'config_name必须', //名称
			ConfigBean::$value.POINST."require " => 'value必须', //值
			ConfigBean::$type.POINST."require " => 'type必须', //1 input 2 图片 3富文本
			ConfigBean::$createdAt.POINST."require " => 'created_at必须', //
			ConfigBean::$updatedAt.POINST."require " => 'updated_at必须', //
		];
		$this->scene = [
			self::$all => [ConfigBean::$id,ConfigBean::$configKey,ConfigBean::$configName,ConfigBean::$value,ConfigBean::$type,ConfigBean::$createdAt,ConfigBean::$updatedAt,],
			self::$add => [],
			self::$edit => [],
			self::$pkId => [],
		];
	}


}
